package com.guashu.designpatterns.chainresponsibility;

// LoginHandler.java

/**
 * 用于验证用户名密码是否正确。
 */
public class LoginHandler extends Handler<Member> {

    @Override
    public void doHandler(Member member) {
        if (!"jack".equals(member.getUserName()) || !"666".equals(member.getPassWord())) {
            System.out.println("用户名密码不正确");
            return;
        }
        if (null != next) {
            next.doHandler(member);
        }
    }
}

